package com.example.core.handler;

import com.example.core.event.AsyncEvent;
import com.google.common.eventbus.EventBus;

import javax.annotation.Resource;

public abstract class AbstractEventHandler implements EventHandler {

    @Resource
    private EventBus eventBus;

    @Override
    public void send(Object object) {
        AsyncEvent asyncEvent = new AsyncEvent();
        asyncEvent.setObject(object);
        asyncEvent.setHandler(this);
        eventBus.post(asyncEvent);
    }
}
